package com.itxx.date.newDateDemo;

import java.time.MonthDay;
import java.time.Year;
import java.time.YearMonth;

public class NewDemo3 {
    public static void main(String[] args) {
        //获取当前时间的年份  Year.now();
        Year nowYear = Year.now();
        System.out.println(nowYear);

        //获取当前时间的月份   YearMonth.now()
        YearMonth yearMoth = YearMonth.now();
        System.out.println(yearMoth);

        //获取当前时间的日   MonthDay.now()
        MonthDay monthDay = MonthDay.now();
        System.out.println(monthDay);
    }
}
